package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile    string `gorm:"type:char(11)" json:"mobile"`
	Password  string `gorm:"type:char(32)" json:"password"`
	HeadImage string `gorm:"type:varchar(500)" json:"headImage"`
	NickName  string `gorm:"type:varchar(50)" json:"nickName"`
}
type Class struct {
	gorm.Model
	Name string `gorm:"type:varchar(50)" json:"name"`
}
type House struct {
	gorm.Model
	Title        string  `gorm:"type:varchar(30)" json:"title"`
	Price        float64 `gorm:"type:decimal(10,2)" json:"price"`
	Context      string  `gorm:"type:varchar(500)" json:"context"`
	ClassId      int     `gorm:"type:int(11)" json:"classId"`
	UserId       int     `gorm:"type:int(11)" json:"userId"`
	CollectCount int     `gorm:"type:int(11)" json:"collectCount"`
}
type Comment struct {
	gorm.Model
	Context   string `gorm:"type:varchar(500)" json:"context"`
	UserId    int    `gorm:"type:int(11)" json:"userId"`
	HouseId   int    `gorm:"type:int(11)" json:"houseId"`
	LikeCount int    `gorm:"type:int(11) " json:"likeCount"`
}
type Collect struct {
	gorm.Model
	UserId  int `gorm:"type:int(11)" json:"userId"`
	HouseId int `gorm:"type:int(11)" json:"houseId"`
}
type HouseData struct {
	gorm.Model
	House
	ClassName string
	UserName  string
}
